<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style>
.outer, .outer2{
    height: 500px;
}
.left {
    float: left;
    height: 100%;
    width: 200px;
    background-color: #bbffaa;
}
.right {
    height: 100%;
    background-color: blue;
}
.left2 {
    width: 200px;
    height: 100%;
    background: red;
    float: left;
}
/*右侧元素设置overflow: hidden; 这样右边就触发了BFC，BFC的区域不会与浮动元素发生重叠，所以两侧就不会发生重叠*/
.right2 {
    height: 100%;
    background: green;
    overflow: hidden;
}
</style>
<body>
<div class="outer">
    <div class="left"></div>
    <div class="right"></div>
</div>
<div class="outer2">
    <div class="left2"></div>
    <div class="right2"></div>
</div>
</body>
</html>
